export interface TertiaryCategory {
    name: string;
    code: string;
  }
  
  export interface SecondaryCategory {
    name: string;
    code: string;
    directions: TertiaryCategory[];
  }
  
  export interface PrimaryCategory {
    name: string;
    code: string;
    subcategories: SecondaryCategory[];
  }
  
  export const getBadgeNameByAssociation = (association: string): string => {
    for (const primary of categories) {
      for (const secondary of primary.subcategories) {
        for (const tertiary of secondary.directions) {
          if (tertiary.code === association) {
            return tertiary.name; // 返回铭牌名称
          }
        }
      }
    }
    return "未知铭牌"; // 如果未找到匹配的铭牌，返回默认值
  };
  
  export const categories: PrimaryCategory[] = [
    {
      name: "计算机类",
      code: "00",
      subcategories: [
        {
          name: "软件开发",
          code: "0000",
          directions: [
            { name: "Web开发", code: "000000" },
            { name: "移动应用开发（Android、iOS）", code: "000001" },
            { name: "桌面软件开发（Windows、macOS、Linux）", code: "000002" },
            { name: "游戏开发（引擎开发、客户端/服务器端）", code: "000003" },
            { name: "嵌入式软件开发", code: "000004" },
          ],
        },
        {
          name: "人工智能与数据科学",
          code: "0001",
          directions: [
            { name: "机器学习 / 深度学习", code: "000100" },
            { name: "自然语言处理（NLP）", code: "000101" },
            { name: "计算机视觉", code: "000102" },
            { name: "数据分析 / 数据挖掘", code: "000103" },
            { name: "大数据工程（Hadoop、Spark）", code: "000104" },
            { name: "推荐系统 / 搜索引擎开发", code: "000105" },
          ],
        },
        {
          name: "云计算与系统运维",
          code: "0002",
          directions: [
            { name: "云平台开发与管理（阿里云、AWS、Azure）", code: "000200" },
            { name: "DevOps（CI/CD、自动化运维）", code: "000201" },
            { name: "系统运维（Linux/Windows 服务器）", code: "000202" },
            { name: "容器与微服务（Docker、Kubernetes）", code: "000203" },
          ],
        },
        {
          name: "网络安全",
          code: "0003",
          directions: [
            { name: "应用安全（Web漏洞扫描、加固）", code: "000300" },
            { name: "网络防御（IDS/IPS、防火墙）", code: "000301" },
            { name: "数据安全与加密", code: "000302" },
            { name: "安全审计与渗透测试", code: "000303" },
          ],
        },
        {
          name: "区块链与Web3",
          code: "0004",
          directions: [
            { name: "区块链底层开发（如以太坊智能合约）", code: "000400" },
            { name: "DeFi应用", code: "000401" },
            { name: "NFT/元宇宙平台开发", code: "000402" },
          ],
        },
        {
          name: "计算机硬件与系统",
          code: "0005",
          directions: [
            { name: "操作系统开发", code: "000500" },
            { name: "驱动开发", code: "000501" },
            { name: "嵌入式系统与单片机", code: "000502" },
            { name: "计算机体系结构", code: "000503" },
          ],
        },
        {
          name: "虚拟化与边缘计算",
          code: "0006",
          directions: [
            { name: "虚拟化平台（VMware、Xen）", code: "000600" },
            { name: "边缘计算与IoT集成", code: "000601" },
          ],
        },
      ],
    },
    {
      name: "通信类",
      code: "01",
      subcategories: [
        {
          name: "无线通信",
          code: "0100",
          directions: [
            { name: "移动通信（2G/3G/4G/5G/6G）", code: "010000" },
            { name: "卫星通信", code: "010001" },
            { name: "蜂窝网络设计与优化", code: "010002" },
          ],
        },
        {
          name: "光通信",
          code: "0101",
          directions: [
            { name: "光纤通信（WDM、PON）", code: "010100" },
            { name: "光传输设备研发（OTN）", code: "010101" },
          ],
        },
        {
          name: "通信网络技术",
          code: "0102",
          directions: [
            { name: "网络规划与优化", code: "010200" },
            { name: "路由交换设备研发（华为、思科）", code: "010201" },
            { name: "SDN/NFV（软件定义网络 / 网络功能虚拟化）", code: "010202" },
          ],
        },
        {
          name: "物联网（IoT）",
          code: "0103",
          directions: [
            { name: "通信协议设计（LoRa、NB-IoT、Zigbee）", code: "010300" },
            { name: "IoT平台开发", code: "010301" },
            { name: "传感器与终端设备接入", code: "010302" },
          ],
        },
        {
          name: "通信信号处理",
          code: "0104",
          directions: [
            { name: "模拟/数字调制解调", code: "010400" },
            { name: "信号滤波与处理算法", code: "010401" },
            { name: "基带信号处理芯片开发", code: "010402" },
          ],
        },
        {
          name: "通信系统集成与运维",
          code: "0105",
          directions: [
            { name: "通信工程项目管理", code: "010500" },
            { name: "基站建设与维护", code: "010501" },
            { name: "通信设备运维", code: "010502" },
          ],
        },
      ],
    },
    {
      name: "电子工程类",
      code: "02",
      subcategories: [
        {
          name: "集成电路设计",
          code: "0200",
          directions: [
            { name: "数字IC设计（FPGA、ASIC）", code: "020000" },
            { name: "模拟IC设计（ADC/DAC、PLL）", code: "020001" },
            { name: "射频IC设计（5G、WiFi芯片）", code: "020002" },
            { name: "存储器设计（DRAM、NAND Flash）", code: "020003" },
            { name: "电源管理IC设计", code: "020004" },
          ],
        },
        {
          name: "电路板设计",
          code: "0201",
          directions: [
            { name: "PCB设计（多层板、高速信号）", code: "020100" },
            { name: "EMC/EMI设计", code: "020101" },
            { name: "热设计（散热、热仿真）", code: "020102" },
            { name: "可制造性设计（DFM）", code: "020103" },
          ],
        },
        {
          name: "测试与验证",
          code: "0202",
          directions: [
            { name: "ATE测试程序开发", code: "020200" },
            { name: "功能验证（SystemVerilog、UVM）", code: "020201" },
            { name: "物理验证（DRC、LVS）", code: "020202" },
            { name: "可靠性测试（HTOL、ESD）", code: "020203" },
          ],
        },
        {
          name: "半导体工艺",
          code: "0203",
          directions: [
            { name: "CMOS工艺开发", code: "020300" },
            { name: "先进封装技术（3D IC、SiP）", code: "020301" },
            { name: "光刻工艺优化", code: "020302" },
            { name: "薄膜沉积与刻蚀", code: "020303" },
          ],
        },
      ],
    },
    {
      name: "机械工程类",
      code: "03",
      subcategories: [
        {
          name: "机械设计",
          code: "0300",
          directions: [
            { name: "CAD建模（SolidWorks、CATIA）", code: "030000" },
            { name: "有限元分析（FEA）", code: "030001" },
            { name: "机械传动设计", code: "030002" },
            { name: "精密机械设计", code: "030003" },
            { name: "工业设计", code: "030004" },
          ],
        },
        {
          name: "制造工艺",
          code: "0301",
          directions: [
            { name: "数控加工（CNC编程）", code: "030100" },
            { name: "3D打印技术", code: "030101" },
            { name: "注塑成型工艺", code: "030102" },
            { name: "焊接工艺", code: "030103" },
            { name: "表面处理技术", code: "030104" },
          ],
        },
        {
          name: "自动化控制",
          code: "0302",
          directions: [
            { name: "PLC编程", code: "030200" },
            { name: "工业机器人应用", code: "030201" },
            { name: "运动控制系统", code: "030202" },
            { name: "传感器集成", code: "030203" },
          ],
        },
        {
          name: "流体机械",
          code: "0303",
          directions: [
            { name: "泵与风机设计", code: "030300" },
            { name: "压缩机技术", code: "030301" },
            { name: "流体仿真（CFD）", code: "030302" },
            { name: "液压系统设计", code: "030303" },
          ],
        },
      ],
    },
    {
      name: "生物技术类",
      code: "04",
      subcategories: [
        {
          name: "生物制药",
          code: "0400",
          directions: [
            { name: "抗体药物开发", code: "040000" },
            { name: "基因治疗", code: "040001" },
            { name: "细胞治疗", code: "040002" },
            { name: "疫苗研发", code: "040003" },
            { name: "生物类似药", code: "040004" },
          ],
        },
        {
          name: "基因工程",
          code: "0401",
          directions: [
            { name: "CRISPR基因编辑", code: "040100" },
            { name: "基因合成", code: "040101" },
            { name: "基因检测", code: "040102" },
            { name: "合成生物学", code: "040103" },
          ],
        },
        {
          name: "生物信息学",
          code: "0402",
          directions: [
            { name: "基因组学分析", code: "040200" },
            { name: "蛋白质组学", code: "040201" },
            { name: "生物数据库开发", code: "040202" },
            { name: "系统生物学建模", code: "040203" },
          ],
        },
        {
          name: "医疗器械",
          code: "0403",
          directions: [
            { name: "诊断设备开发", code: "040300" },
            { name: "植入式器械", code: "040301" },
            { name: "康复设备", code: "040302" },
            { name: "医疗影像设备", code: "040303" },
          ],
        },
      ],
    },
    {
      name: "材料科学类",
      code: "05",
      subcategories: [
        {
          name: "金属材料",
          code: "0500",
          directions: [
            { name: "合金设计", code: "050000" },
            { name: "金属加工工艺", code: "050001" },
            { name: "金属腐蚀与防护", code: "050002" },
            { name: "金属3D打印", code: "050003" },
          ],
        },
        {
          name: "高分子材料",
          code: "0501",
          directions: [
            { name: "塑料改性", code: "050100" },
            { name: "橡胶技术", code: "050101" },
            { name: "纤维材料", code: "050102" },
            { name: "生物降解材料", code: "050103" },
          ],
        },
        {
          name: "陶瓷材料",
          code: "0502",
          directions: [
            { name: "结构陶瓷", code: "050200" },
            { name: "功能陶瓷", code: "050201" },
            { name: "陶瓷基复合材料", code: "050202" },
            { name: "陶瓷3D打印", code: "050203" },
          ],
        },
        {
          name: "纳米材料",
          code: "0503",
          directions: [
            { name: "碳纳米管", code: "050300" },
            { name: "石墨烯", code: "050301" },
            { name: "量子点", code: "050302" },
            { name: "纳米复合材料", code: "050303" },
          ],
        },
      ],
    },
    {
      name: "航空航天类",
      code: "06",
      subcategories: [
        {
          name: "飞行器设计",
          code: "0600",
          directions: [
            { name: "飞机总体设计", code: "060000" },
            { name: "发动机设计", code: "060001" },
            { name: "气动设计", code: "060002" },
            { name: "结构设计", code: "060003" },
            { name: "无人机设计", code: "060004" },
          ],
        },
        {
          name: "航天技术",
          code: "0601",
          directions: [
            { name: "卫星设计", code: "060100" },
            { name: "火箭技术", code: "060101" },
            { name: "空间站技术", code: "060102" },
            { name: "深空探测", code: "060103" },
          ],
        },
        {
          name: "航空电子",
          code: "0602",
          directions: [
            { name: "航电系统", code: "060200" },
            { name: "导航系统", code: "060201" },
            { name: "通信系统", code: "060202" },
            { name: "雷达技术", code: "060203" },
          ],
        },
        {
          name: "推进技术",
          code: "0603",
          directions: [
            { name: "涡轮发动机", code: "060300" },
            { name: "火箭发动机", code: "060301" },
            { name: "电推进", code: "060302" },
            { name: "核推进", code: "060303" },
          ],
        },
      ],
    },
    {
      name: "能源技术类",
      code: "07",
      subcategories: [
        {
          name: "可再生能源",
          code: "0700",
          directions: [
            { name: "太阳能技术", code: "070000" },
            { name: "风能技术", code: "070001" },
            { name: "水能技术", code: "070002" },
            { name: "地热能", code: "070003" },
            { name: "生物质能", code: "070004" },
          ],
        },
        {
          name: "储能技术",
          code: "0701",
          directions: [
            { name: "锂电池技术", code: "070100" },
            { name: "燃料电池", code: "070101" },
            { name: "超级电容器", code: "070102" },
            { name: "压缩空气储能", code: "070103" },
          ],
        },
        {
          name: "核能技术",
          code: "0702",
          directions: [
            { name: "核反应堆设计", code: "070200" },
            { name: "核燃料循环", code: "070201" },
            { name: "核安全技术", code: "070202" },
            { name: "核废料处理", code: "070203" },
          ],
        },
        {
          name: "智能电网",
          code: "0703",
          directions: [
            { name: "电网调度", code: "070300" },
            { name: "电力电子", code: "070301" },
            { name: "微电网技术", code: "070302" },
            { name: "电力市场", code: "070303" },
          ],
        },
      ],
    },
    {
      name: "环境工程类",
      code: "08",
      subcategories: [
        {
          name: "水处理技术",
          code: "0800",
          directions: [
            { name: "污水处理", code: "080000" },
            { name: "饮用水净化", code: "080001" },
            { name: "海水淡化", code: "080002" },
            { name: "工业废水处理", code: "080003" },
          ],
        },
        {
          name: "大气污染控制",
          code: "0801",
          directions: [
            { name: "烟气脱硫脱硝", code: "080100" },
            { name: "VOCs治理", code: "080101" },
            { name: "颗粒物控制", code: "080102" },
            { name: "碳捕集技术", code: "080103" },
          ],
        },
        {
          name: "固废处理",
          code: "0802",
          directions: [
            { name: "垃圾焚烧", code: "080200" },
            { name: "垃圾填埋", code: "080201" },
            { name: "资源回收", code: "080202" },
            { name: "危险废物处理", code: "080203" },
          ],
        },
        {
          name: "环境监测",
          code: "0803",
          directions: [
            { name: "在线监测系统", code: "080300" },
            { name: "环境传感器", code: "080301" },
            { name: "遥感监测", code: "080302" },
            { name: "环境大数据", code: "080303" },
          ],
        },
      ],
    },
    {
      name: "化学工程类",
      code: "09",
      subcategories: [
        {
          name: "化工工艺",
          code: "0900",
          directions: [
            { name: "反应器设计", code: "090000" },
            { name: "分离技术", code: "090001" },
            { name: "传热传质", code: "090002" },
            { name: "过程优化", code: "090003" },
          ],
        },
        {
          name: "精细化工",
          code: "0901",
          directions: [
            { name: "涂料技术", code: "090100" },
            { name: "胶粘剂", code: "090101" },
            { name: "表面活性剂", code: "090102" },
            { name: "香料香精", code: "090103" },
          ],
        },
        {
          name: "石油化工",
          code: "0902",
          directions: [
            { name: "炼油工艺", code: "090200" },
            { name: "石化产品", code: "090201" },
            { name: "催化技术", code: "090202" },
            { name: "石油化工安全", code: "090203" },
          ],
        },
        {
          name: "绿色化工",
          code: "0903",
          directions: [
            { name: "清洁生产", code: "090300" },
            { name: "生物化工", code: "090301" },
            { name: "循环经济", code: "090302" },
            { name: "绿色催化剂", code: "090303" },
          ],
        },
      ],
    },
    {
      name: "土木工程类",
      code: "0A",
      subcategories: [
        {
          name: "结构工程",
          code: "0A00",
          directions: [
            { name: "建筑结构设计", code: "0A0000" },
            { name: "桥梁工程", code: "0A0001" },
            { name: "地下工程", code: "0A0002" },
            { name: "结构健康监测", code: "0A0003" },
          ],
        },
        {
          name: "交通工程",
          code: "0A01",
          directions: [
            { name: "道路设计", code: "0A0100" },
            { name: "交通规划", code: "0A0101" },
            { name: "智能交通", code: "0A0102" },
            { name: "轨道交通", code: "0A0103" },
          ],
        },
        {
          name: "水利工程",
          code: "0A02",
          directions: [
            { name: "水工结构", code: "0A0200" },
            { name: "水资源管理", code: "0A0201" },
            { name: "防洪工程", code: "0A0202" },
            { name: "灌溉工程", code: "0A0203" },
          ],
        },
        {
          name: "岩土工程",
          code: "0A03",
          directions: [
            { name: "地基处理", code: "0A0300" },
            { name: "边坡工程", code: "0A0301" },
            { name: "隧道工程", code: "0A0302" },
            { name: "岩土勘察", code: "0A0303" },
          ],
        },
      ],
    },
  ];
